package com.isoft.controller.sys;

import com.isoft.bean.Result;
import com.isoft.anno.SysControllerLogAnnotation;
import com.isoft.bean.OprateType;
import com.isoft.bean.ResponseData;
import com.isoft.bean.SysType;
import com.isoft.controller.BaseController;
import com.isoft.entity.AirportChange;
import com.isoft.entity.Luggage;
import com.isoft.entity.PageBean;
import com.isoft.service.impl.LuggageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@Slf4j
@RestController
@RequestMapping("/sys/luggage")
public class LuggageController extends BaseController {
    @Autowired
    LuggageService luggageService;

    @GetMapping("/gets")
    public Result page(@RequestParam(defaultValue = "1") Integer page ,
                       @RequestParam(defaultValue = "10") Integer pageSize)
    {
        log.info("分页查询 ：{},{}" , page , pageSize);
        PageBean pageBean = luggageService.getAll(page , pageSize);
        return Result.success(pageBean);
    }
    //更新行李信息
    @SysControllerLogAnnotation(sysType = SysType.SUPER, operateType = OprateType.UPDATE, desc = "更新行李数据")
    @PutMapping("/update")
    public ResponseData<Boolean> updateLug(@RequestBody Luggage luggage){
        return  returnBoolean(luggageService.updateLug(luggage));
    }

}
